class CommonModel<T> {
  late bool success;
  late int code;
  late String message;
  late T? data;

  CommonModel({required this.success, required this.code, required this.message, required this.data});

  CommonModel.fromJson(Map<String, dynamic> json) {
    success = json['success'];
    code = json['code'];
    message = json['message'];
    data = json['data'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['success'] = success;
    data['code'] = code;
    data['message'] = message;
    data['data'] = this.data;
    return data;
  }
}
